Skip to content

fix ibm benchmark on frontier + amd#1159

Open
anandrdbz wants to merge 1 commit intoMFlowCode:masterfrom
anandrdbz:master
Open

fix ibm benchmark on frontier + amd#1159
anandrdbz wants to merge 1 commit intoMFlowCode:masterfrom
anandrdbz:master

Conversation

@anandrdbz
Copy link
Contributor

@anandrdbz anandrdbz commented Feb 18, 2026

User description

Description

Simple bug fix that was introduced in a recent PR; AMD compilers don't like update device when the array bounds are 1:0.

Fixes #(issue)

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other: describe

Testing

How did you test your changes?

Checklist

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

CodeAnt-AI Description

Prevent GPU update when there are zero ghost points to avoid AMD failure

What Changed

  • The subroutine returns immediately when the ghost-point count is less than 1, so no GPU update or kernel launch is attempted for empty arrays
  • Removes the condition that caused AMD compilers or runtimes to reject an update with an array slice of bounds 1:0
  • All other behavior for non-empty ghost-point arrays is unchanged

Impact

✅ Runs IBM benchmark on Frontier without AMD compile/runtime error
✅ Fewer GPU launch failures when arrays are empty
✅ Stable execution when no ghost points are present

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Bug Fixes
    • Improved performance by preventing unnecessary processing when no items require computation.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 18, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

An early exit condition is added to the s_apply_levelset function that immediately returns when the number of ghost points is less than 1, skipping GPU updates and per-ghost-point processing.

Changes

Cohort / File(s) Summary
Early Exit Optimization
src/simulation/m_compute_levelset.fpp
Added guard clause in s_apply_levelset to skip processing when num_gps < 1, preventing unnecessary GPU updates and ghost-point iterations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

Review effort 2/5, size:XS

Poem

🐰 An early exit, swift and clean,
When zero ghosts dance on the scene,
No GPU load, no loops to spin,
Just skip and return—optimization wins!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description includes most required sections but lacks critical testing details and GPU verification confirmations despite modifying GPU code. Complete the Testing section with specific test procedures, and confirm GPU parity checks and AMD GPU testing in the GPU changes section by checking the appropriate boxes.
Title check ❓ Inconclusive The title 'fix ibm benchmark on frontier + amd' is somewhat vague and lacks specificity about the actual bug being fixed. Clarify the title to mention the core issue (e.g., 'Prevent GPU update when ghost-point array bounds are empty') for better clarity about the specific bug being addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Feb 18, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 18, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • GPU update guarding
    The root cause is a GPU update with an array slice gps(1:num_gps) when num_gps==0. A safer pattern is to guard individual GPU directives/launches with a conditional (so only GPU calls are skipped) rather than returning from the entire subroutine. This keeps CPU-side behaviors intact if the routine evolves.

  • Early-return semantics
    The added early return (when there are no ghost points) prevents any further execution of the subroutine. This is likely intentional to avoid launching GPU updates with an empty slice, but it also skips every subsequent statement (including non-GPU logic that might be added later). Confirm that skipping all remaining code for num_gps <= 0 is correct for all current and future callers.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 18, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 44.06%. Comparing base (c5493c1) to head (8095bb3).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/simulation/m_compute_levelset.fpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1159      +/-   ##
==========================================
- Coverage   44.07%   44.06%   -0.01%     
==========================================
  Files          70       70              
  Lines       20431    20431              
  Branches     1974     1975       +1     
==========================================
- Hits         9004     9003       -1     
  Misses      10291    10291              
- Partials     1136     1137       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant